package com.googlecode.afdbaccess.config.injectconfig;

import javax.annotation.PreDestroy;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;

import com.googlecode.afdbaccess.cache.Transaction;

@RequestScoped
public class RequestTransaction extends Transaction {
    protected RequestTransaction() {
        super();
    }
    
    @Inject
    protected RequestTransaction(InjectableCacheReferenceHolder cacheReferenceHolder) {
        super(cacheReferenceHolder.getDbCache());
    }
    
    @SuppressWarnings("unused")
    @PreDestroy
    private void autoClose() {
        super.close("autoclose");
    }
}
